<template>
  <el-container style="margin: 5px 0 0% 5%;">
    <el-main style="width: 75%;background-color: white;padding: 0 20px 0 20px;">
      <div class="main-box">
        <div style="margin: 5px 5px 5px 10px">
          <label class="course-title">{{courseName}}</label>
        </div>
        <div style="margin-top: 5px;">
          <div style="width: 100%;display: flex; text-align: right">
            <p style="width: 70%"/>
            <label style="font-size: 15px;color: gray">{{teacherName}}</label>
          </div>
          <div style="width: 100%;display: flex; text-align: right">
            <p style="width: 70%"/>
            <div style="text-align: center">
              <el-button v-if="teacherId == this.$store.state.user.id" style="width: 100px; height: 40px;" type="primary" @click="start">
                {{play_status==false?'直播':'停播'}}
              </el-button>
            </div>
          </div>
        </div>
        <hr class="style-two" style="margin-bottom: 20px; margin-top: 20px">

        <div style="height: 55px; margin-bottom: 20px">
          <div style="width: 100%;" v-if="teacherId == this.$store.state.user.id">
            <el-switch
              style="margin: 0 5px 0 40px"
              v-model="mode"
              active-text="屏幕分享"
              inactive-text="摄像头推流"
              :disabled="play_status==false || isPushing == true">
            </el-switch>
            <el-button size="mini" :disabled="play_status==false"
                       @click="isPushing == false ? (mode == false ? startRTC():pushScreen()):stopPush()">
              {{isPushing==false?'开始推流':'停止推流'}}
            </el-button>
          </div>
          <div style="width: 100%;margin-top: 10px">
            <template v-if="isPushing === true">
              <el-switch
                v-model="enableCamera"
                inactive-text="打开摄像头/屏幕分享"
                active-text="关闭摄像头/屏幕分享"
                style="margin: 0 5px 0 40px"
                v-on:change="toggleCamera()">
              </el-switch>
              <el-switch
                v-model="enableMic"
                inactive-text="关闭麦克风"
                active-text="打开麦克风"
                style="margin: 0 5px 0 5px"
                v-on:change="toggleMic()">
              </el-switch>
            </template>
          </div>
        </div>
        <div style="text-align: center; display: flex;margin-top: 10px">
          <p style="width: 130px"/>
          <div id="video_wrap"/>
        </div>
      </div>
    </el-main>
    <el-aside style="width: 30%;padding-right: 5%">
      <el-container direction="vertical" style="width: 100%">
        <el-aside style="width: 100%">
          <!--<div class="top-box">-->
            <!--<el-container style="margin: 0 0 0 0;padding: 0 0 0 0;" direction="vertical">-->
              <!--<span style="color: cornflowerblue;font-size: 25px;margin-bottom: 10px">成员管理</span>-->
              <!--<div class="member-box">-->
                <!--<div v-for="member in members" :key="member" style="text-align: center">-->
                  <!--<span style="color: darkgray;font-size: 15px">{{member}}</span>-->
                <!--</div>-->
              <!--</div>-->
            <!--</el-container>-->
          <!--</div>-->
        </el-aside>
        <el-aside style="width: 100%">
          <div class="bottom-box">
            <el-container style="margin: 0 0 0 0;padding: 0 0 0 0;" direction="vertical">
              <span style="color: cornflowerblue;font-size: 25px;margin-bottom: 10px">消息</span>
              <div class="chat-box">
                <div v-for="msg in msgs" :key="msg" style="text-align: left">
                  <span
                    style="color: darkgray;font-size: 15px;margin: 5px 5px 5px 5px">{{msg.send}}:{{msg.content}}</span>
                </div>
              </div>
            </el-container>
            <div>
                <!--autosize="minRows: 2; maxRows: 2"-->
              <el-input
                type="textarea"
                placeholder="发表一下评论"
                :disabled="play_status == false"
                v-model="imMsg.common.data" @keydown.enter="sendMsg" style="margin-bottom: 5px">
              </el-input>
              <el-button :disabled="play_status == false" type="primary" @click="sendMsg">发送</el-button>
            </div>
          </div>
          <!--<div id="playerId" class="tcplayer"></div>-->
        </el-aside>
      </el-container>
    </el-aside>
  </el-container>
</template>

<script>
// import {TcPlayer} from 'tc-player-plus'

export default {
  name: 'courseclass',
  data () {
    return {
      // 课程名称
      courseName: '课程名称',
      teacherName: '',
      teacherId: '',
      // 课程Id
      courseId: '1',
      // 在课堂的学生id
      members: [
        '成员4',
        '成员3',
        '成员2',
        '成员1'
      ],
      // 播放状态，是否开播
      play_status: false,

      tips1: '',

      tips2: '',
      teacherInfo: '',
      // sdk用
      pushModel: 0,
      account: 'Web_trtc_01', // 用户ID
      userID: this.account,
      sdkAppId: 1400234803,
      userSig: '000', // 后台获取,参数是userID
      nickName: this.userId,
      roomInfo: '',
      roomID: '', // 课程id
      isTeacher: true,
      enableCamera: true,
      enableMic: true,
      // users: TEST_ACCOUNT.users,
      msgs: [],
      isPushing: false, // 是否正在推流
      mode: false,
      isPushCamera: 0, // 是否推摄像头流
      devices: {
        camera: [],
        mic: []
      },

      cameraIndex: 0,
      micIndex: 0,

      imMsg: {
        common: {},
        custom: {}
      },

      boardData: {
        data: {
          current: null,
          list: []
        },
        page: {
          current: 0,
          total: 0
        }
      },

      remoteVideos: {},
      boardFileGroup: [], // 白板文件组
      currentFile: null // 当前文件
    }
  },
  watch: {
    // 当msgs中的内容改变时将滚轮滚到最后
    msgs: {
      handler (newV, oldV) {
        setTimeout(
          () => {
            var div = document.getElementById('chat-box')
            div.scrollTop = div.scrollHeight
          }, 10)
      },
      deep: true
    }
  },
  methods: {
    start () {
      if (this.play_status == false) {
        this.createSig()
        // console.log(this.account)
        // console.log('xxx ' + this.userSig)
        // console.log(this.roomID)
        if (!this.roomID) {
          this.showErrorTip('房间号不能为空')
          return
        }
        // this.step = 'second';
        // setTimeout(this.init(), 10000)
        this.init()
        // this.play_status = true
      } else {
        this.quitClassroom()
        this.play_status = false
      }
    },

    showErrorTip (title, time) {
      // this.$toasted.error(title, {
      // alert(title, {
      this.$message(title, {
        position: 'top-right',
        duration: time || 2000
      })
    },

    showTip (title, time) {
      // this.$toasted.show(title, {
      // alert(title, {
      this.$message(title, {
        position: 'top-right',
        duration: time || 2000
      })
    },

    initData () {
      this.msgs = []
      this.isPushing = false // 是否正在推流
      this.isPushCamera = 0 // 是否推摄像头流

      this.devices = {
        camera: [],
        mic: []
      }

      this.cameraIndex = 0
      this.micIndex = 0

      this.imMsg = {
        common: {
          data: '',
          toUser: ''
        },
        custom: {
          data: '',
          toUser: ''
        }
      }

      // localStorage.setItem('IIC_USERID', this.account);

      this.enableCamera = true
      this.enableMic = true
      this.remoteVideos = {}
      this.boardFileGroup = [] // 白板文件组
      this.currentFile = null // 当前文件
    },

    init () {
      this.initData()
      // console.log(this.roomID)
      this.tic = null
      this.tic = new TIC({})
      this.tic.init(this.sdkAppId, res => {
        if (res.code) {
          this.showErrorTip('初始化失败，code:' + res.code + ' msg:' + res.desc)
          // alert("加载Tic失败");
        } else {
          this.showTip('初始化成功')
          // alert("加载Tic成功");
          this.Tlogin()
        }
      })
    },

    // 登录
    Tlogin () {
      this.tic.login({
        userId: this.account,
        // userSig: this.findUserSig(this.account)
        userSig: this.userSig
      }, (res) => {
        if (res.code) {
          this.showErrorTip('登录失败')
          console.error(res)
        } else {
          this.showTip('登录成功')

          // 增加事件监听
          this.addTICMessageListener()
          this.addTICEventListener()
          this.addTICStatusListener()

          this.createClassroom()
        }
      })
    },

    createClassroom () {
      // console.log(this.roomID)
      this.tic.createClassroom(this.roomID, (res) => {
        if (res.code) {
          this.showErrorTip('创建课堂失败')
          console.error(res)
          // this.step = 'first';
        } else {
          this.showTip('创建课堂成功')
          // console.log(res)

          this.joinClassroom()
        }
      })
    },

    joinClassroom () {
      this.roomID && this.tic.joinClassroom(this.roomID, {}, {
        id: 'paint_box',
        boardContentFitMode: 2
      }, res => {
        if (res.code) {
          this.showErrorTip('加入课堂失败')
          console.error(res)
          // this.step = 'first';
        } else {
          this.showTip('加入课堂成功')
          // this.tic.getMembers(this.roomID,(res) =>{
          //   if(res.code){
          //     console.log('获取成员失败');
          //   }else{
          //     console.log(res);
          //   }
          // });
          this.play_status = true
          window.TRTC = this.TRTC = this.tic.getWebRTCInstance()
          this.initTRTCEvent()
        }
      })
    },

    // TRTC事件
    initTRTCEvent () {
      this.TRTC.on('onLocalStreamAdd', (data) => {
        if (data && data.stream) {
          var localVideoEl = document.getElementById('local_video')
          if (!localVideoEl) {
            localVideoEl = document.createElement('video')
            localVideoEl.id = 'local_video'
            localVideoEl.class = 'col-md-1'
            document.querySelector('#video_wrap').insertBefore(localVideoEl, null)
          }
          localVideoEl.muted = true
          localVideoEl.autoplay = true
          localVideoEl.playsinline = true
          localVideoEl.srcObject = data.stream
          this.showTip('WebRTC接收到本地流')
          this.isPushing = true // 正在推流
        }
      })

      this.TRTC.on('onRemoteStreamUpdate', (data) => {
        var userVideoEl = document.getElementById(data.videoId)
        if (!userVideoEl) {
          userVideoEl = document.createElement('video')
          userVideoEl.id = data.videoId
          userVideoEl.class = 'col-md-1'
          document.querySelector('#video_wrap').appendChild(userVideoEl)
        }
        userVideoEl.autoplay = true
        userVideoEl.playsinline = true
        userVideoEl.srcObject = data.stream

        this.showTip('WebRTC接收到远端流')
      })

      this.TRTC.on('onRemoteStreamRemove', (data) => {
        var userVideoEl = document.getElementById(data.videoId)
        if (userVideoEl) {
          userVideoEl.remove()
        }
        this.showTip('WebRTC 远端流断开')
      })

      this.TRTC.on('onWebSocketClose', (data) => {
        this.showTip('WebRTC WebSocket 断开')
      })

      this.TRTC.on('onRelayTimeout', (data) => {
        this.showTip('WebRTC 超时')
      })

      this.TRTC.on('onStreamNotify', (data) => {
        // console.log('==================== onStreamNotify==', data)
      })
    },

    /**
       * 退出课堂
       */
    quitClassroom () {
      // this.tic.quitClassroom(res => {
      //   if (res.code) {
      //     this.showErrorTip('退出课堂失败')
      //     console.error(res)
      //   } else {
      //     this.step = 'first'
      //     this.showTip('退出课堂成功')
      //   }
      // })
      this.tic.destroyClassroom(this.roomID, res => {
        if (res.code) {
          this.showErrorTip('销毁课堂失败')
          console.error(res)
        } else {
          this.step = 'first'
          this.showTip('销毁课堂成功')
        }
      })
    },

    /**
       * 销毁课堂
       */
    destroyClassroom () {
      this.tic.destroyClassroom(this.roomID, res => {
        if (res.code) {
          this.showErrorTip('销毁课堂失败')
          console.error(res)
        } else {
          this.step = 'first'
          this.showTip('销毁课堂成功')
        }
      })
    },

    /**
       * 增加IM消息监听回调
       */
    addTICMessageListener () {
      this.tic.addTICMessageListener({

        /**
           * 收到C2C文本消息
           * @param fromUserId    发送此消息的用户id
           * @param text        收到消息的内容
           * @param textLen      收到消息的长度
           */
        onTICRecvTextMessage: (fromUserId, text, textLen) => {
          this.msgs.push({
            send: fromUserId + '：',
            content: text
          })
        },

        /**
           * 收到C2C自定义消息
           * @param fromUserId    发送此消息的用户id
           * @param data        收到消息的内容
           * @param dataLen      收到消息的长度
           */
        onTICRecvCustomMessage: (fromUserId, data, textLen) => {
          this.msgs.push({
            send: fromUserId + '：',
            content: data
          })
        },

        /**
           * 收到群文本消息
           * @param fromUserId    发送此消息的用户id
           * @param text        收到消息的内容
           * @param textLen      收到消息的长度
           */
        onTICRecvGroupTextMessage: (fromUserId, text, textLen) => {
          this.msgs.push({
            send: fromUserId + '：',
            content: text
          })
        },

        /**
           * 收到群自定义消息
           * @param fromUserId    发送此消息的用户id
           * @param data        收到消息的内容
           * @param dataLen      收到消息的长度
           */
        onTICRecvGroupCustomMessage: (fromUserId, data, textLen) => {
          this.msgs.push({
            send: fromUserId + '：',
            content: data
          })
        },

        /**
           * 所有消息
           * @param msg  IM消息体
           * @note 所有收到的消息都会在此回调进行通知，包括前面已经封装的文本和自定义消息（白板信令消息除外）
           */
        onTICRecvMessage (msg) {

        }
      })
    },

    // 事件监听回调
    addTICEventListener () {
      this.tic.addTICEventListener({
        onTICMemberJoin: (members) => {
          this.msgs.push({
            send: '群消息提示：',
            content: members.join(',') + '进入课堂'
          })
          this.members.push(
            {name: members}
            // members
          )
          // console.log(this.members);
          // window.sessionStorage.setItem("studentMembers",this.members);
          // console.log(window.sessionStorage.getItem("studentMembers"));
        },

        onTICMemberQuit: (members) => {
          this.msgs.push({
            send: '群消息提示：',
            content: members.join(',') + '退出课堂'
          })
          this.members.pop(
            {name: members}
            // members
          )
          // window.sessionStorage.setItem("studentMembers",this.members);
        },

        onTICClassroomDestroy: () => {
          if (!this.isTeacher) { // 学生处理
            this.quitClassroom()
            this.showTip(`老师解散了课堂`)
          }
        }
      })
    },

    // IM状态监听回调
    addTICStatusListener () {
      this.tic.addTICStatusListener({
        onTICForceOffline: () => {
          alert(`其他地方登录，被T了`)
          // this.step = 'first';
        }
      })
    },

    // 启动推流(推摄像头)
    startRTC () {
      // 获取webrtc实例
      var WebRTC = this.TRTC
      WebRTC.getLocalStream({
        audio: true,
        video: true,
        attributes: {
          width: 638,
          height: 359
        }
      }, (data) => {
        this.isPushCamera = true
        if (WebRTC.global.localStream && WebRTC.global.localStream.active) {
          WebRTC.updateStream({
            role: 'screen',
            stream: data.stream
          }, () => {
            // 成功

          }, (error) => {
            this.showErrorTip(`更新流失败，${error}`)
          })
        } else {
          WebRTC.startRTC({
            stream: data.stream,
            role: 'user'
          }, (data) => {
            // 成功
          }, (error) => {
            this.showErrorTip(`推流失败, ${error}`)
          })
        }
      }, (error) => {
        this.showErrorTip(`获取本地流失败, ${JSON.stringify(error)}`)
      })
    },

    stopPush () {
      var WebRTC = this.tic.getWebRTCInstance()
      WebRTC.stopRTC({}, () => {
        this.isPushing = false
        document.querySelector('#local_video').srcObject = null
      })
    },

    /**
       * 推屏幕分享
       */
    pushScreen () {
      var WebRTC = this.tic.getWebRTCInstance()
      WebRTC.getLocalStream({
        screen: true,
        screenSources: 'tab',
        attributes: {
          width: 638,
          height: 359,
          frameRate: 10
        }
      }, (data) => {
        this.isPushCamera = false
        if (WebRTC.global.localStream && WebRTC.global.localStream.active) {
          WebRTC.updateStream({
            role: 'screen',
            stream: data.stream
          }, () => {
            // 成功
          }, (error) => {
            this.showErrorTip(`更新流失败，${error}`)
          })
        } else {
          WebRTC.startRTC({
            stream: data.stream,
            role: 'user'
          }, (data) => {
            // 成功
          }, (error) => {
            this.showErrorTip(`推流失败, ${error}`)
          })
        }
      }, (error) => {
        this.showErrorTip(`获取本地流失败, ${error}`)
      })
    },

    /**
       * 摄像头开关
       */
    toggleCamera () {
      // this.enableCamera = !this.enableCamera
      var WebRTC = this.tic.getWebRTCInstance()
      this.enableCamera ? WebRTC.openVideo() : WebRTC.closeVideo()
    },

    /**
       * 麦克风开关
       */
    toggleMic () {
      // this.enableMic = !this.enableMic
      var WebRTC = this.tic.getWebRTCInstance()
      this.enableMic ? WebRTC.openAudio() : WebRTC.closeAudio()
    },

    /**
       * 枚举摄像头
       */
    getCameraDevices () {
      var WebRTC = this.tic.getWebRTCInstance()
      WebRTC.getVideoDevices(devices => {
        this.devices.camera = devices
      })
    },

    /**
       * 切换摄像头
       */
    switchCamera () {
      if (this.cameraIndex < 0) {
        return
      }
      var WebRTC = this.tic.getWebRTCInstance()
      WebRTC.chooseVideoDevice(this.devices.camera[this.cameraIndex])
    },

    /**
       * 枚举麦克风
       */
    getMicDevices () {
      var WebRTC = this.tic.getWebRTCInstance()
      WebRTC.getAudioDevices(devices => {
        this.devices.mic = devices
      })
    },

    /**
       * 切换麦克风
       */
    switchMic () {
      if (this.micIndex < 0) {
        return
      }
      var WebRTC = this.tic.getWebRTCInstance()
      WebRTC.chooseAudioDevice(this.devices.mic[this.micIndex])
    },

    /**
       * 发送普通文本消息
       */
    sendMsg () {
      if (!this.imMsg.common.data) {
        this.showErrorTip(`不能发送空消息`)
      }

      // C2C 文本
      if (this.imMsg.common.toUser) {
        this.tic.sendTextMessage(this.imMsg.common.toUser, this.imMsg.common.data, function (res) {
          // console.log('===sendTextMessage:', res)
        })
      } else { // 群组 文本
        this.tic.sendGroupTextMessage(this.imMsg.common.data, function (res) {
          // console.log('===sendTextMessage:', res)
        })
      }
      this.imMsg.common.data = ''
    },

    /**
       * 发送自定义消息
       */
    sendCustomGroupMsg () {
      //
      if (this.imMsg.common.toUser) { // C2C 自定义
        this.tic.sendCustomMessage(this.imMsg.common.toUser, this.imMsg.custom.data, function (res) {
          // console.log('===sendCustomGroupMsg:', res)
        })
      } else { // 群组 自定义
        this.tic.sendGroupCustomMessage(this.imMsg.custom.data, function (res) {
          // console.log('===sendCustomGroupMsg:', res)
        })
      }
    },
    createSig () {
      var _this = this

      this.getRequest('/api/live/sig?uid=' + this.user.id).then(resp => {
        if (resp && resp.status == 200) {
          // console.log(resp)
          _this.userSig = resp.data.data
          // console.log('uuuu ' + _this.userSig)
          // console.log(_this.roomID)
        }
      })
    },
    chat_submit (e) {
      e.preventDefault()
      this.temp_text = this.temp_text.trim()
      if (!this.temp_text) {
        return
      }
      this.msgs.push({
        name: 'me',
        msg: this.temp_text
      })
      this.temp_text = ''
    }
    // open () {
    //   var _this = this
    //   if (!_this.play_status) {
    //     this.getRequest('/api/live/push?cid=' + this.courseId).then((response) => {
    //       if (response.data.code === 200) {
    //         var s = response.data.data.pushCode
    //         var secu = s.substring(s.lastIndexOf('/') + 1)
    //         var pushCode = s.substring(0, s.lastIndexOf('/'))
    //         _this.tips1 = ('推流地址:' + pushCode)
    //         _this.tips2 = ('密匙:' + secu)
    //         console.log(_this.tips1)
    //         console.log(_this.tips2)
    //         const h = this.$createElement
    //         this.$msgbox({
    //           title: '直播方法',
    //           message: h('p', null, [
    //             h('span', null, '请将以下推流码及推流密匙填入OBS中进行推流：'),
    //             h('br', null, null),
    //             h('span', null, _this.tips1),
    //             h('br', null, null),
    //             h('span', null, _this.tips2)
    //           ])
    //         })
    //       } else {
    //         this.$alert(response.data.msg, '标题名称', {
    //           confirmButtonText: '确定'
    //         })
    //       }
    //       this.play_status = true
    //     }).catch((response) => {
    //       this.$alert('请求失败！', '直播', {
    //         confirmButtonText: '确定'
    //       })
    //     })
    //   } else {
    //     const h = this.$createElement
    //     this.$msgbox({
    //       title: '直播方法',
    //       message: h('p', null, [
    //         h('span', null, '请将以下推流码及推流密匙填入OBS中进行推流：'),
    //         h('br', null, null),
    //         h('span', null, _this.tips1),
    //         h('br', null, null),
    //         h('span', null, _this.tips2)
    //       ])
    //     })
    //   }
    // }
  },
  mounted () {
    // this.courseId = this.$route.query.id
    // console.log('ID::', this.courseId)
    // console.log('TEACHERID::', this.teacherId)
    // if (this.teacherId != this.$store.state.user.id) {
    //   this.$router.replace('/live?id=' + this.courseId)
    // }
    window.addEventListener('beforeunload', function (e) {
      this.quitClassroom()
    })
    this.getRequest('/api/live/sig?uid=' + this.user.id).then(resp => {
      if (resp && resp.status == 200) {
        // console.log(resp)
        this.userSig = resp.data.data
      }
    })
  },
  created () {
    this.courseId = this.$route.query.id
    this.getRequest('/api/course/detail?id=' + this.$route.query.id)
      .then(resp => {
        if (resp && resp.status == 200) {
          var data = resp.data.data
          // console.log('data:::', data)
          this.courseName = data.title
          this.teacherName = data.userDetailModel.name
          this.teacherId = data.userDetailModel.id
          if (!data.userDetailModel.id == this.$store.state.user.id) {
            // console.log('--*--*--*--')
            this.$router.push('/live?id=' + this.$route.query.id)
          }
          if (this.teacherId != this.$store.state.user.id) {
            this.$router.replace('/live?id=' + this.courseId)
          }
        }
      })
    this.account = this.user.id
    this.nickName = this.user.name
    this.roomID = parseInt('201625010' + this.courseId)
  },
  beforeDestroy () {
    this.quitClassroom()
  },
  computed: {
    user () {
      return this.$store.state.user
    }
  }
}
</script>

<style scoped>
  @import url("//imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.css");

  .course-title {
    font-family: Hiragino Sans GB, Arial, sans-serif;
    color: cornflowerblue;
    font-size: 30px
  }

  .top-box {
    border-radius: 15px;
    background-clip: padding-box;
    margin: 20px auto;
    width: 80%;
    box-sizing: border-box;
    padding: 35px 10px 15px 10px;
    border: 1px solid #eaeaea;
    box-shadow: 0 0 25px #cac6c6;
    text-align: center;
  }

  .bottom-box {
    border-radius: 15px;
    background-clip: padding-box;
    margin: 20px auto;
    width: 80%;
    box-sizing: border-box;
    padding: 35px 10px 10px 10px;
    /*background: #fff;*/
    border: 1px solid #eaeaea;
    box-shadow: 0 0 25px #cac6c6;
    text-align: center;
  }

  .main-box {
    border-radius: 15px;
    background-clip: padding-box;
    margin: 20px auto;
    height: 595px;
    padding: 10px 35px 15px 35px;
    background: #fff;
    border: 1px solid #eaeaea;
    box-shadow: 0 0 25px #cac6c6;
  }

  .style-two { /*透明渐变水平线*/
    width: 90%;
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
  }

  .chat-box {
    border: darkgray solid;
    border-radius: 5px;
    border-width: 1px;
    height: 150px;
    overflow: auto;
    margin-bottom: 10px;
  }

  .member-box {
    height: 150px;
    overflow: auto;
    margin-bottom: 10px;
  }

  /*.tcplayer {*/
    /*margin: auto;*/
    /*margin-left: 13%;*/
  /*}*/
</style>
